export const exportTable = (table, fileName) => {
  const html = `<html><head><meta charset='utf-8' /></head><body>${table}</body></html>`;
  const aTag = document.createElement('a');
  const blob = new Blob([html], { type: 'application/vnd.ms-excel' });
  aTag.download = `${ fileName ?fileName:new Date().getTime()}.xls`;
  aTag.href = URL.createObjectURL(blob);
  aTag.click();
  URL.revokeObjectURL(blob);
};

